package com.yingoo.controller;

import com.yingoo.api.HanderRequest;
import com.yingoo.api.HttpParam;
import com.yingoo.api.IHanderApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by lenovo on 2017/7/31.
 */
@Service
public class DownloadHander implements IHanderApi {
    @Autowired
    private AnalyseHander leaderHander;
    @Autowired
    private HttpClientUtil httpClientUtil;
    public void handerRequest(HanderRequest request) {
        HttpParam httpParam = new HttpParam();
        httpParam.setUrl(request.getUrl());

        String result = httpClientUtil.getHtml(httpParam);
        System.out.println("result:"+result);
        request.setRequest(result);
        leaderHander.handerRequest(request);
    }
}
